//
//  Student.h
//  CompareDemo
//
//  Created by 向祖华 on 16/4/27.
//  Copyright © 2016年 向祖华. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface Student : NSObject
@property (nonatomic, retain) NSString *name;
@property (nonatomic, assign) NSInteger age;
@property (nonatomic, assign) CGFloat score;
@property (nonatomic, assign) NSInteger number;

//初始化方法
-(id)initWithName:(NSString*)name
              age:(NSInteger)age
            score:(CGFloat)score
           number:(NSInteger)number;
//遍历构造器
+(id)studentWithName:(NSString*)name
                 age:(NSInteger)age
               score:(CGFloat)score
              number:(NSInteger)number;
//按照学生姓名排序
-(NSComparisonResult)compareByName:(Student*)student;
//按照学生年龄排序
-(NSComparisonResult)compareByAge:(Student*)student;
//按照学生分数
-(NSComparisonResult)compareByScore:(Student*)student;
//按照学生学号排序
-(NSComparisonResult)compareByNumber:(Student*)student;

@end
